<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        for (var i = 0; i < 9; i++) {
            for (var n = 0; n <= i; n++) {
                document.write('*')
            }
            document.write('<br>')
        }
        for (var i = 0; i < 9; i++) {
            for (var n = i; n < 9; n++) {
                document.write('*')
            }
            document.write('<br>')
        }
        for (var i = 0; i < 9; i++) {
            for (var n = 0; n < i; n++) {
                document.write('&nbsp')
            }
            for (var m = i; m < 9; m++) {
                document.write('*')
            }
            document.write('<br>')
        }
        for (var i = 0; i < 9; i++) {
            for (var n = i; n < 9; n++) {
                document.write('&nbsp')
            }
            for (var m = 0; m < i; m++) {
                document.write('*')
            }
            document.write('<br>')
        }
    </script>
</body>

</html>